<template>
    <div id="app" v-loading='loading' element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
        <router-view></router-view> 　
    </div>
</template>

<script>
    import {
        bus
    } from './bus.js';
    import {
        mapState
    } from "vuex";
    export default {
        name: 'app',
        data() {
            return {

            }
        },
        mounted() {
            var flag = true;
            if (navigator.userAgent.indexOf("MSIE") > 0) {
                if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
                    flag = false;
                }
                if (navigator.userAgent.indexOf("MSIE 7.0") > 0) {
                    flag = false;
                }
                if (navigator.userAgent.indexOf("MSIE 8.0") > 0) {
                    flag = false;
                }
                if (navigator.userAgent.indexOf("MSIE 9.0") > 0) {
                    flag = false;
                }
            }
            if (flag == false) {
                this.$notify({
                    message: '升级至IE10以上或使用谷歌浏览器获取优质体验',
                    duration: 0,
                });
            };

            bus.$on('goto', (e) => {
                if (e == '/login') {
                    this.$router.push('/')
                    this.$router.push('/login')
                } else if (e == '/notfound') {
                    this.$router.push('/notfound')
                }
            })
            bus.$on('message', (e) => {
                //                this.$message.error('出现请求错误')
            })
        },
        computed: {
            ...mapState(["loading"]),
        },
    }

</script>
<style lang="scss">
    #app {
        //background-image: url('assets/images/bg2.png');
        background-repeat: no-repeat;
        background-size: 100% 100%;
        height: 100vh;
        overflow: hidden;
    }
</style>
